package com.py.credit.dao;

import com.py.credit.common.Page;
import com.py.credit.entity.Feedback;
import com.py.credit.entity.Measure;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.LinkedHashMap;
import java.util.List;

public interface PluginApiDao {

    List<LinkedHashMap> getDeptAjbhList(@Param(value = "deptId") String deptId, @Param(value = "ztmc") String ztmc);

    String getLabel(@Param(value = "deptId") String deptId,@Param(value = "ztmc") String ztmc,@Param(value = "jclb") String jclb);

    List<LinkedHashMap> getCsList(@Param(value = "deptId") String deptId,@Param(value = "gzNameList") List<String> gzNameList,@Param(value = "jclb") String jclb);

    String selectAjbhByCsIdAndZtmc(@Param(value = "deptId") String deptId,@Param(value = "csId") String csId,@Param(value = "ztmc") String ztmc,@Param(value = "jclb") String jclb);

    int insertFeedbackInfo(Feedback feedback);

    void insertFeedbackCs(@Param(value = "feedbackId") int feedbackId, @Param(value = "csId") String csId,@Param(value = "batchId") String batchId);

    void modifyMess(@Param(value = "feedbackType") String feedbackType, @Param(value = "feedbackTime") Timestamp feedbackTime, @Param(value = "ajbh") String ajbh);

    List<String> selectAllUrl(@Param(value = "userId") long userId);

    List<LinkedHashMap> selectUrlForPage(@Param(value = "userId") long userId,
                                         @Param(value = "page") Page page);

    void insertUrl(@Param(value = "urlName") String urlName, @Param(value = "url") String url,@Param(value = "userId") long userId);

    void modifyUrl(@Param(value = "urlName") String urlName,
                   @Param(value = "url") String url,
                   @Param(value = "status") String status,
                   @Param(value = "delFlag") String delFlag,
                   @Param(value = "id") String id);

    List<LinkedHashMap> selectJcListForPage(@Param(value = "deptId") String deptId,
                                            @Param(value = "ztmc") String ztmc,
                                            @Param(value = "jclb") String jclb,
                                            @Param(value = "page")Page page,
                                            @Param(value = "startTime") String startTime,
                                            @Param(value = "endTime") String endTime);

    List<LinkedHashMap> selectJcDetail(@Param(value = "ztmc") String ztmc,
                                       @Param(value = "jclb") String jclb,
                                       @Param(value = "gzNameList") List<String> gzNameList);

    List<LinkedHashMap> selectFeedbackListForPage(@Param(value = "deptId") String deptId,
                                                  @Param(value = "ztmc") String ztmc,
                                                  @Param(value = "page")Page page,
                                                  @Param(value = "jclb") String jclb,
                                                  @Param(value = "status") String status,
                                                  @Param(value = "startTime") String startTime,
                                                  @Param(value = "endTime") String endTime);

//    Timestamp selectFeedbackTime(@Param(value = "ztmc") String ztmc,@Param(value = "jclb") String jclb,@Param(value = "gzNameList") List<String> gzNameList);

    List<Feedback> selectFeedbackDetail(@Param(value = "ztmc") String ztmc,
                                        @Param(value = "jclb") String jclb,
                                        @Param(value = "gzNameList") List<String> gzNameList);

    List<Measure> selectMeasureDetail(@Param(value = "batchId") String batchId);

    void insertApiLog(@Param(value = "userId") long userId,
                      @Param(value = "ztmc") String ztmc,
                      @Param(value = "bm") String bm,
                      @Param(value = "ipaddress") String ipaddress);

    int selectPluginApiCount(@Param(value = "userId") long userId);

    int selectFeedbackCount(@Param(value = "userId") long userId);
}

